package com.example.user.service;
import com.alibaba.boot.dubbo.annotation.DubboConsumer;
import com.example.pojo.GdUser;
import com.example.service.RpcRegisterService;
import org.springframework.stereotype.Component;
/**
 * Created by LENOVO on 2018/8/17.
 */
@Component
public class RegisterServiceImpl implements RegisterService {

    @DubboConsumer
    private RpcRegisterService rpcRegisterService;
    @Override
    public void registerUserByPhone(GdUser user) throws Exception {

        rpcRegisterService.registerUserByPhone(user);
    }

    @Override
    public boolean validateSms(String phone, String code) throws Exception {

        return rpcRegisterService.validateSms(phone,code);
    }

    @Override
    public boolean findUserByUserCode(String erCode) throws Exception {
        return rpcRegisterService.findUserByUserCode(erCode);
    }

    @Override
    public void registerUserByMail(GdUser user) throws Exception {
        rpcRegisterService.registerUserByMail(user);
    }

    @Override
    public boolean activateMail(String mail, String code) throws Exception {
       return rpcRegisterService.activateMail(mail,code);
    }
}
